<?php
namespace app\model\mysql;

use think\Model;

class Order extends Model {

    protected $name = "order";

    protected $hidden = ["is_delete"];

    protected $autoWriteTimestamp = true;

    protected $createTime = "created_time";

    protected $updateTime = "updated_time";

    public function saveData($data = []) : bool {
        $model = $this;
        if (isset($data["id"]) && $data["id"]) {
            $model = $this->where("id", $data["id"]);
        }

        return $model->save($data);
    }
}